package com.choupin.choupin.entity;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

public class User extends BaseEntity {
    Integer id; //用户表
    String phone ;//手机号，可用登入账号
    Integer memberId;//外键，会员表ID
    String password ;//密码
    String salt ;//盐值
    String nickname; //昵称
    Integer gender; //性别，0男或1女
    Date birthday; //出生日期
    Integer age; //年龄
    String avatar; // 头像
    Integer  weight; //中奖概率
    private Integer  count; // '抽奖次数',
    Integer isVip; // 0为开通  1开通
    Integer  isDelete; // 是否删除，0代表未删除，1代表已删除

    public User() {
    }

    public User(Integer id, String phone, Integer memberId, String password, String salt, String nickname, Integer gender, Date birthday, Integer age, String avatar, Integer weight, Integer count, Integer isVip, Integer isDelete) {
        this.id = id;
        this.phone = phone;
        this.memberId = memberId;
        this.password = password;
        this.salt = salt;
        this.nickname = nickname;
        this.gender = gender;
        this.birthday = birthday;
        this.age = age;
        this.avatar = avatar;
        this.weight = weight;
        this.count = count;
        this.isVip = isVip;
        this.isDelete = isDelete;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getMemberId() {
        return memberId;
    }

    public void setMemberId(Integer memberId) {
        this.memberId = memberId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getIsVip() {
        return isVip;
    }

    public void setIsVip(Integer isVip) {
        this.isVip = isVip;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) &&
                Objects.equals(phone, user.phone) &&
                Objects.equals(memberId, user.memberId) &&
                Objects.equals(password, user.password) &&
                Objects.equals(salt, user.salt) &&
                Objects.equals(nickname, user.nickname) &&
                Objects.equals(gender, user.gender) &&
                Objects.equals(birthday, user.birthday) &&
                Objects.equals(age, user.age) &&
                Objects.equals(avatar, user.avatar) &&
                Objects.equals(weight, user.weight) &&
                Objects.equals(count, user.count) &&
                Objects.equals(isVip, user.isVip) &&
                Objects.equals(isDelete, user.isDelete);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, phone, memberId, password, salt, nickname, gender, birthday, age, avatar, weight, count, isVip, isDelete);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", phone='" + phone + '\'' +
                ", memberId=" + memberId +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", nickname='" + nickname + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", age=" + age +
                ", avatar='" + avatar + '\'' +
                ", weight=" + weight +
                ", count=" + count +
                ", isVip=" + isVip +
                ", isDelete=" + isDelete +
                ", createdUser='" + createdUser + '\'' +
                ", createdTime=" + createdTime +
                ", modifiedUser='" + modifiedUser + '\'' +
                ", modifiedTime=" + modifiedTime +
                '}';
    }
}
